<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>


    <title>Chart_05</title>
</head>
<body>
    <h1>5.4.1数组降维</h1>
    <p>二维数组：<p>
    <p>1 2 3 4 5<p>
    <p>6 7 8 9 10<p>
        <button type="button" id="reduceArray">开始计算</button>
    <p id="result_01"></p>

<script>
    $(document).ready(function(){
        $("#reduceArray").click(function(){

            var theArray = [[1,2,3,4,5],[6,7,8,9,10]];
            console.log(theArray);
            var res = theArray.reduce(function (resArray,p) {
                return resArray.concat(p);
            });


            $("#result_01").text(res);
        });
    });
</script>
</body>
</html>